import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
// import Highcharts from 'highcharts';
import echarts  from 'echarts';
import 'echarts/src/chart/pie';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
  private option:any;
  constructor(public navCtrl: NavController) {
  }
  ionViewWillEnter(){
    let dom = (Object)(document.getElementById("chart"));
    let myChart = echarts.init(dom);
    let app = {};
    this.option = {
        tooltip : {
            formatter: "{a} <br/>{b} : {c}%"
        },
        series: [
            {
                name: '',
                type: 'gauge',
                detail: {formatter:'{value}'},
                data: [{value: 50, name: '今日步数'}],
                radius:130,
                color:'#5CACEE'

            }
        ]
    };
    this.option.series[0].data[0].value = <any>(Math.floor(Math.random() * 100).toFixed(2)) - 0;
    myChart.setOption(this.option, true);
 } 

}
